home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BCI NET
/
BCI NET Dec 94.iso
/
archives
/
telecomm
/
bbs
/
axshsupp.lha
/
AXsh-SZIMEX03.lha
/
SubZeroImport.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-01-02
|
2KB
|
97 lines
/****** SubZeroImport.rexx ***************************************************
*
* $VER: SubZeroImport 0.3á (02-Jan-93) - A Mail/News tosser for SubZeroNet
*
******************************************************************************
*
* Naming conventions:
* ~~~~~~~~~~~~~~~~~~~
* Mail {machine}.mail.{ufn} Mail batch
* News {machine}.news.{ufn} News batch
*
* Xfer {machine}.uucp.{ufn} TrapDoor transfer archive
*
******************************************************************************/
SIGNAL ON HALT
SIGNAL ON ERROR
SIGNAL ON BREAK_C
OPTIONS FAILAT 21
INBOUND = 'IN:'
BAKDIR = 'IN:Bax/'
UUSPOOL = 'AXSH:usr/spool/'
UUMAIL = UUSPOOL || 'mail/' /* Home of mail */
UUNEWS = UUSPOOL || 'news/' /* Home of news */
UUBATCH = UUSPOOL || 'batch/' /* Temporary dir */
MY_MACH = 'mink' /* This is my machine */
STRLEN = LENGTH(MY_MACH) + 6 /* '.mail.' or '.news.' */
FILEPAT = INBOUND || MY_MACH || '.uucp.????????'
NETWORK = 'subzero.dk'
suppLib = 'rexxsupport.library'
/*****************************************************************************/
IF ~SHOW('L',suppLib) THEN CALL ADDLIB(suppLib,0,-30,0)
/*
** Clean up /usr/spool/(mail|news)/
*/
IF EXISTS(UUMAIL || MY_MACH || '.' || NETWORK) THEN DO
ADDRESS COMMAND 'AXSH:bin/MailServer'
END
IF EXISTS(UUNEWS || MY_MACH || '.' || NETWORK) THEN DO
ADDRESS COMMAND 'AXSH:bin/RN net fakemachine.subzero.dk unpack'
END
/*
** Unpack pending archives from inbound to /usr/spool/batch/
*/
ADDRESS COMMAND 'LhA -x0 e' FILEPAT UUBATCH /* Extract archives */
ADDRESS COMMAND 'Move' FILEPAT BAKDIR /* Backup */
dirList = SHOWDIR(UUBATCH,'F')
/*
** Here we go - one bundle at a time
*/
DO i = 1 TO WORDS(dirList)
fileName = UPPER(WORD(dirList,i))
IF LEFT(fileName,STRLEN) == UPPER(MY_MACH) || '.MAIL.' THEN DO
ADDRESS COMMAND 'Copy' UUBATCH || fileName UUMAIL || MY_MACH || '.' || NETWORK
ADDRESS COMMAND 'AXSH:bin/MailServer'
CALL DELETE(UUBATCH || fileName)
END
ELSE
IF LEFT(fileName,STRLEN) == UPPER(MY_MACH) || '.NEWS.' THEN DO
ADDRESS COMMAND 'Copy' UUBATCH || fileName UUNEWS || MY_MACH || '.' || NETWORK
ADDRESS COMMAND 'AXSH:bin/RN net fakemachine.subzero.dk unpack'
CALL DELETE(UUBATCH || fileName)
END
END
EXIT
HALT:
BREAK_C:
SAY '***Break: User abort requested!'
EXIT 1
ERROR:
SAY '***Break: Error in line' SIGL
EXIT 10
/*
** EOF
*/